package com.pug.zixun.controller.msg;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.pug.zixun.controller.BaseController;
import com.pug.zixun.pojo.KssMsgSystem;
import com.pug.zixun.service.msg.IKssMsgSystemService;
import com.pug.zixun.vo.KssSystemMsgVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 谢迅
 * @version 1.0
 * @date 2022/10/10 17:21
 */
@RestController
public class SystemMsgController extends BaseController {
    @Autowired
    private IKssMsgSystemService kssMsgSystemService;
    @PostMapping("/systemMsg/load")
    public IPage<KssMsgSystem> load(@RequestBody KssSystemMsgVo kssSystemMsgVo){
       return kssMsgSystemService.findMsgSystemPage(kssSystemMsgVo);
    }
    @PostMapping("/systemMsg/del/{id}")
    public boolean del(@PathVariable("id") Long id){
        return kssMsgSystemService.delById(id);
    }
    @PostMapping("/systemMsg/saveOrUpdate")
    public KssMsgSystem saveOrUpdate(@RequestBody KssMsgSystem kssMsgSystem){
        kssMsgSystemService.saveOrUpdate(kssMsgSystem);
        return kssMsgSystem;
    }
}
